<template>
	<view class="container">
		<!-- 纵向排列 -->
		<uni-steps :options="dataList" direction="column" :active="active">
		</uni-steps>
		
		<view class="flex f-column f-align w100" v-if="isfetch && dataList.length == 0">
			<text class="font36 gray999 bold mt50">暂无服务跟踪</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: [],
				active: 0,
				isfetch: false
			}
		},
		onLoad(option) {
			this.getDataList(option.id)
		},
		methods: {
			getDataList(id) {
				this.$http.ajax({
					url: '/OrderState/list',
					params: {
						orderDetailNumber: id
					}
				}).then((res) => {
					this.isfetch = true
					if (res.code == 0) {
						this.dataList = res.data.map(item => {
							return { 
								title: item.orderState, 
								desc: item.orderStateTime, 
								photo: !item.orderStateUrl ? [] : item.orderStateUrl.split(','),
								adminName: item.adminName
							}
						})
						this.active = (res.count - 1)
					}
				})
			},
		}
	}

</script>

<style scoped lang="scss">
	.container {
		padding: 45rpx 32rpx;
	}
</style>
